<?php
if (!$SlotCheckWhere) {
   if (!$cat) {
      $cat = mysql_result(mysql_query("SELECT `id` FROM `category` WHERE `default`='1' LIMIT 1 "), 0);
   }
   $SlotCheckWhere = " WHERE `status`<'3' AND `category`='".$cat."' AND `slot` ";
}
if (!$SlotCheckOrderBy) $SlotCheckOrderBy = " ORDER BY `slot` ASC ";

$SlotCheckSQL = "SELECT * FROM `album` " . $SlotCheckWhere . $SlotCheckOrderBy;
$SlotCheckResult = mysql_query($SlotCheckSQL);
if ($do === 'showEmpty' || !$do) {
	$count = 1;
	echo('<h3>Available slot numbers for this category:</h3><br />');
	
	while($SlotCheckRow = mysql_fetch_array($SlotCheckResult)) {
		$SlotArray[$count] = $SlotCheckRow['slot'];
		$count++;
	}
	for ($i = 1; $i <= (count($SlotArray) + 6); $i++) {
		if (!in_array($i, $SlotArray)) echo($i . ', ');
	}
}
?>